﻿// -------------------------------------------------------------------------
//    @FileName         :    NFSixExperimentPart.cpp
//    @Author           :    gaoyi
//    @Date             :    24-8-30
//    @Email            :    445267987@qq.com
//    @Module           :    NFSixExperimentPart
//
// -------------------------------------------------------------------------

#include "NFSixExperimentPart.h"

#include "proto_cs_login.pb.h"
#include "proto_db.pb.h"

NFSixExperimentPart::NFSixExperimentPart()
{
    if (EN_OBJ_MODE_INIT == NFShmMgr::Instance()->GetCreateMode())
    {
        CreateInit();
    }
    else
    {
        ResumeInit();
    }
}

NFSixExperimentPart::~NFSixExperimentPart()
{
}

int NFSixExperimentPart::CreateInit()
{
    return 0;
}
    
int NFSixExperimentPart::ResumeInit()
{
    return 0;
}

int NFSixExperimentPart::LoadFromDB(const proto_ff::tbRoleDetail *pDBData)
{
    m_stData.FromPb(pDBData->role_play_data().six_experiment_data());
    return 0;
}

int NFSixExperimentPart::InitConfig(proto_ff::tbRoleDetail *pDbData, const RoleOne &stRoleOne)
{
    pDbData->mutable_role_play_data()->mutable_six_experiment_data()->set_max_reward_score(0);
    pDbData->mutable_role_play_data()->mutable_six_experiment_data()->set_last_start_time(0);
    pDbData->mutable_role_play_data()->mutable_six_experiment_data()->set_last_end_time(0);
    return 0;
}

int NFSixExperimentPart::SaveDB(proto_ff::tbRoleDetail *pDBData)
{
    m_stData.ToPb(pDBData->mutable_role_play_data()->mutable_six_experiment_data());
    return 0;
}

int NFSixExperimentPart::MakePlayerDataCS(proto_ff::Proto_CSGetRoleRsp* pCSGetRoleRsp)
{
    m_stData.ToPb(pCSGetRoleRsp->mutable_six_experiment_data());
    return 0;
}

int NFSixExperimentPart::MakeCityPlayerData(proto_ff::CityRoleInfo* pGCCityRoleInfo)
{
    return 0;
}

